-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[21314] Improve resilience against clock adjustments (backport #5018) #5189
Open
mergify
wants to merge
4
commits into
2.14.x
Choose a base branch
from
mergify/bp/2.14.x/pr-5018
base: 2.14.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+66
−96
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cherry-pick of ccc690c has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
11 tasks
This was referenced Sep 2, 2024
JesusPoderoso
force-pushed
the
mergify/bp/2.14.x/pr-5018
branch
from
September 23, 2024 10:00
0eed014
to
bef43f7
Compare
JesusPoderoso
force-pushed
the
mergify/bp/2.14.x/pr-5018
branch
from
September 23, 2024 10:01
bef43f7
to
8b67465
Compare
JesusPoderoso
requested review from
MiguelCompany
and removed request for
MiguelCompany
September 23, 2024 10:02
MiguelCompany
requested changes
Sep 23, 2024
* Use steady_clock instead of high_resolution_clock for status checks (high_resolution_clock might not be steady depending on STL impl) Signed-off-by: Matthias Schneider <[email protected]> * Use steady_clock instead for system_clock for calculating timeouts Signed-off-by: Matthias Schneider <[email protected]> * Use correct clock's duration for duration_cast Signed-off-by: Matthias Schneider <[email protected]> * Use Time_t::now() Signed-off-by: Matthias Schneider <[email protected]> * Fix build. Signed-off-by: Miguel Company <[email protected]> * Refs #21314. Refactor on DataWriterImpl. Signed-off-by: Miguel Company <[email protected]> * Refs #21314. Refactor on DataReaderImpl. Signed-off-by: Miguel Company <[email protected]> * Refs #21314. Refactor on StatefulWriter. Signed-off-by: Miguel Company <[email protected]> * Refs #21314. Protect current_time_since_unix_epoch against clock adjustments. Signed-off-by: Miguel Company <[email protected]> * Revert "Use steady_clock instead of high_resolution_clock for status checks (high_resolution_clock might not be steady depending on STL impl)" This reverts commit d69eb91. --------- Signed-off-by: Matthias Schneider <[email protected]> Signed-off-by: Miguel Company <[email protected]> Co-authored-by: Miguel Company <[email protected]> (cherry picked from commit ccc690c)
Signed-off-by: JesusPoderoso <[email protected]>
JesusPoderoso
force-pushed
the
mergify/bp/2.14.x/pr-5018
branch
from
September 23, 2024 14:43
8b67465
to
a4eb611
Compare
MiguelCompany
requested changes
Sep 23, 2024
Signed-off-by: JesusPoderoso <[email protected]>
MiguelCompany
approved these changes
Sep 23, 2024
MiguelCompany
requested changes
Sep 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix uncrustify
Signed-off-by: JesusPoderoso <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When investigating a system undergoing larger system clock adjustments, I noticed that in some places, std::chrono::system_clock and std::chrono::high_resolution_clock are used for handling timeouts and status check intervals.
However, std::chrono::system_clock is definitely not steady, and std::chrono::high_resolution_clock is not steady quite often (see cppreference).
When undergoing clock adjustments (manually or due to clock server synchronization), timeouts and status checks might no longer be triggered when relying on timestamps based on std::chrono::system_clock.
@Mergifyio backport 2.14.x 2.10.x
Contributor Checklist
Commit messages follow the project guidelines.
The code follows the style guidelines of this project.
Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
N/A Any new/modified methods have been properly documented using Doxygen.
N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
Changes are backport compatible: they do NOT break ABI nor change library core behavior.
Changes are API compatible.
N/A New feature has been added to the
versions.md
file (if applicable).N/A New feature has been documented/Current behavior is correctly described in the documentation.
Applicable backports have been included in the description.
Reviewer Checklist
This is an automatic backport of pull request #5018 done by [Mergify](https://mergify.com).